<?php

namespace Xin\EasyQueue\Webman;

use Webman\RedisQueue\Redis;
use Xin\EasyQueue\Contracts\Dispatcher;

class RedisDispatcher implements Dispatcher
{

    /**
     * @inerhitDoc
     */
    public function dispatch(array $options): bool
    {
        return Redis::connection($options['connection'])->send(
            $options['queue'],
            $options['data'],
            $options['delay'],
        );
    }
}
